<div class="form">
    <script>
    </script>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'customers-form',
	'enableAjaxValidation'=>false,
        'htmlOptions'=>array(
            'enctype'=>'multipart/form-data',
        )
      
    
)); 
    $discount=$model->discount;
    $latecharge=$model->latecharge;
    
    if($model->isNewRecord){
        $latecharge=$discount='0.00';
        
    }
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
        <div class="row">
            
            <?php echo $form->labelEx($model,'image'); ?>
         

            <?php echo $form->fileField($model,'file');?>
            <?php echo $form->error($model,'file'); ?>
        </div>
        <?php if($model->isNewRecord):?>
        
	<div class="row">
            <?php echo $form->labelEx($model,'custno'); ?>
            <?php echo $form->textField($model,'custno',array('size'=>7,'maxlength'=>7)); ?>
            <?php echo $form->error($model,'custno'); ?>
	</div>
        <?php else:?>
            <?php echo $form->hiddenField($model,'custno',array('size'=>7,'maxlength'=>7)); ?>
        <?php endif?>
	<div class="row">
		<?php echo $form->labelEx($model,'lastname'); ?>
		<?php echo $form->textField($model,'lastname',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'lastname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'firstname'); ?>
		<?php echo $form->textField($model,'firstname',array('size'=>25,'maxlength'=>25)); ?>
		<?php echo $form->error($model,'firstname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'add1'); ?>
		<?php echo $form->textField($model,'add1',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'add1'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'add2'); ?>
		<?php echo $form->textField($model,'add2',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'add2'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'city'); ?>
		<?php echo $form->textField($model,'city',array('size'=>30,'maxlength'=>30)); ?>
		<?php echo $form->error($model,'city'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'state'); ?>
		<?php echo $form->dropDownList($model,'state',$model->stateList); ?>
		<?php echo $form->error($model,'state'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'zip'); ?>
		<?php echo $form->textField($model,'zip',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'zip'); ?>
	</div>

	

	<div class="row">
		<?php echo $form->labelEx($model,'creditrate'); ?>
		<?php echo $form->textField($model,'creditrate',array('size'=>7,'maxlength'=>7)); ?>
		<?php echo $form->error($model,'creditrate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'terms'); ?>
		<?php echo $form->dropDownList($model,'terms',$model->termList); ?>
		<?php echo $form->error($model,'terms'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'pricecode'); ?>
		<?php echo $form->textField($model,'pricecode',array('size'=>1,'maxlength'=>1)); ?>
		<?php echo $form->error($model,'pricecode'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'discount'); ?>
                
		<?php echo $form->textField($model,'discount',array(
                    'value'=>$discount
                )); ?>
		<?php echo $form->error($model,'discount'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'latecharge'); ?>
		<?php echo $form->textField($model,'latecharge',array(
                    'value'=>$latecharge
                )); ?>
		<?php echo $form->error($model,'latecharge'); ?>
	</div>
        
        <?php echo $form->hiddenField($model,'custref',array('size'=>15,'maxlength'=>15)); ?>

	
		<?php echo $form->hiddenField($model,'statement'); ?>
	
	<div class="row">
		<?php echo $form->labelEx($model,'lastpaid'); ?>
		<?php echo $form->textField($model,'lastpaid'); ?>
		<?php echo $form->error($model,'lastpaid'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'requirepo'); ?>
		<?php echo $form->checkBox($model,'requirepo'); ?>
		<?php echo $form->error($model,'requirepo'); ?>
	</div>


		<?php echo $form->hiddenField($model,'post'); ?>
	
        <div class="row float">
		<?php echo $form->labelEx($model,'lblphone1'); ?>
                
		<?php echo $form->textField($model,'lblphone1',array('size'=>12,'maxlength'=>12)); ?> &nbsp;
                <?php echo $form->textField($model,'phone1',array('size'=>12,'maxlength'=>12)); ?>
		<?php echo $form->error($model,'lblphone1'); ?>
                <?php echo $form->error($model,'phone1'); ?>
	</div>
        
        <div class="clear"></div>
        
        <div class="row float">
		<?php echo $form->labelEx($model,'lblphone2'); ?>
		<?php echo $form->textField($model,'lblphone2',array('size'=>12,'maxlength'=>12)); ?>&nbsp;
                    <?php echo $form->textField($model,'phone2',array('size'=>12,'maxlength'=>12)); ?>
		<?php echo $form->error($model,'lblphone2'); ?>
                    <?php echo $form->error($model,'phone2'); ?>
	</div>
        
	
        <div class="clear"></div>
        
        <div class="row float">
		<?php echo $form->labelEx($model,'lblphone3'); ?>
		<?php echo $form->textField($model,'lblphone3',array('size'=>12,'maxlength'=>12)); ?>&nbsp;
                    <?php echo $form->textField($model,'phone3',array('size'=>12,'maxlength'=>12)); ?>
		<?php echo $form->error($model,'lblphone3'); ?>
                    <?php echo $form->error($model,'phone3'); ?>
	</div>
	
        <div class="clear"></div>
        
        <div class="row float">
		<?php echo $form->labelEx($model,'lblphone4'); ?>
		<?php echo $form->textField($model,'lblphone4',array('size'=>12,'maxlength'=>12)); ?>&nbsp;
                    <?php echo $form->textField($model,'phone4',array('size'=>12,'maxlength'=>12)); ?>
		<?php echo $form->error($model,'lblphone4'); ?>
                    <?php echo $form->error($model,'phone4'); ?>
	</div>
	
        <div class="clear"></div>


	<div class="row">
		<?php echo $form->labelEx($model,'sort'); ?>
		<?php echo $form->textField($model,'sort',array('size'=>6,'maxlength'=>6)); ?>
		<?php echo $form->error($model,'sort'); ?>
	</div>


		<?php echo $form->hiddenField($model,'defpriority',array('size'=>6,'maxlength'=>6)); ?>
	

	<div class="row">
		<?php echo $form->labelEx($model,'salesperson'); ?>
		<?php echo $form->textField($model,'salesperson',array('size'=>4,'maxlength'=>4)); ?>
		<?php echo $form->error($model,'salesperson'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'customerinactive'); ?>
		<?php echo $form->dropDownList($model,'customerinactive',$model->activeList); ?>
		<?php echo $form->error($model,'customerinactive'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'website'); ?>
		<?php echo $form->textField($model,'website',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'website'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'emailstatement'); ?>
		<?php echo $form->checkBox($model,'emailstatement'); ?>
		<?php echo $form->error($model,'emailstatement'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'datemodified'); ?>
		<?php echo $model->datemodified; ?>
		<?php echo $form->error($model,'datemodified'); ?>
	</div>
        
        
	<div class="row">
		<?php echo $form->labelEx($model,'notes'); ?>
		<?php echo $form->textArea($model,'notes',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'notes'); ?>
	</div>

	<div class="row_buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array(
                    'id'=>'btnSubmitForm',
                    'onclick'=>''
                )); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->